﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using FileModelNS;

namespace FileModelTest
{
	[TestFixture]
	public class TreeTest
	{
		[Test]
		public void testAddRootNodes()
		{
			var tree = new Tree<string>();
			tree.RootNodes.Add(new TreeNode<string>("root"));
			
			Assert.AreEqual( "root", tree.RootNodes[0].Value);
		}

		[Test]
		public void testAddChild()
		{
			var rootNode = new TreeNode<string>("root");
			var tree = new Tree<string>();
			tree.RootNodes.Add(rootNode);

			rootNode.ChildNodes.Add(new TreeNode<string>("child1"));
			rootNode.ChildNodes.Add(new TreeNode<string>("child2"));

			Assert.AreEqual("child1", rootNode.ChildNodes[0].Value);
			Assert.AreEqual("child2", rootNode.ChildNodes[1].Value);
		}

	}
}
